#include "utils.hpp"
#include <algorithm>
#include <iostream>
#include <vector>

void throw_if_not_cond_sample(int num)
{
    throw_if_not(num > 1);
}

void throw_with_message_if_not_cond_sample(int num)
{
    throw_with_message_if_not(num > 1, "Wrong num");
}


void view_of_sample(utils::view_of<int> auto&& num)
{
    std::ranges::copy(num, std::ostream_iterator<int>(std::cout, " "));
    std::cout << "\n";
}

int main()
{
    try
    {
        throw_if_not_cond_sample(0);
    }
    catch(const std::exception& e)
    {
        std::cout << e.what() << std::endl;
    }
    
    try
    {
        throw_with_message_if_not_cond_sample(0);
    }
    catch(const std::exception& e)
    {
        std::cout << e.what() << std::endl;
    }

    const auto nums = std::vector<int>{1, 2, 3, 4, 5};
    view_of_sample(nums);
}
